Brush = Widget.extend({
	ctor:function(){
		this._super();
		this.init();
		this.setTag(TAG_BRUSH_ALL);
	},
	init:function(){
		this.body = new Button(this, 10, TAG_BRUSH, "#brush.png", this.callback,this);
		
		var right1=new Button(this,10,TAG_RIGHT1,"#brush/right1.png",this.callback,this);
		right1.setPosition(this.body.width*0.5,this.body.height*0.5);
		right1.setVisible(false);
		
		var right2=new Button(right1,10,TAG_RIGHT2,"#brush/right2.png",this.callback,this);
		right2.setPosition(right1.width*0.5,right1.height*0.5);
		
		var right3=new Button(right1,10,TAG_RIGHT3,"#brush/right3.png",this.callback,this);
		right3.setPosition(right1.width*0.5,right1.height*0.5);
	},
	callback:function(p){
		var func=cc.callFunc(function() {
			gg.flow.next();
		}, this);
		var right=this.getChildByTag(TAG_RIGHT1);
		switch (p.getTag()) {
		case TAG_BRUSH:
			p.setVisible(false);
			right.setVisible(true);
			var ber=cc.bezierBy(1, [cc.p(-20,35),cc.p(-60,65),cc.p(-400,-40)]);
			var seq=cc.sequence(cc.rotateBy(0.5,8),cc.rotateBy(0.5,-8),cc.rotateBy(0.5,-10),cc.rotateBy(0.5,10)).repeat(3);
			right.runAction(cc.sequence(ber,seq,cc.callFunc(function() {
			right.setVisible(false);
			},this),func));
			break;
		default:
			break;
		}
	}
});
